<script type="text/javascript">
<!--
function save_property_details() {
	document.property_details_form.submit();
}
//-->
</script>
<div id="home_setup">
<form method="post" name="property_details_form" action="">
	<table border="0" width="100%">
	  <tr>
	    <td colspan="2"><h2><?php echo $unit->address;?></h2></td>
	  </tr>
	  <tr>
	    <td width="20%">Address *: </td>
	    <td><input type="text" size="45" name="units[address]" value="<?php echo $unit->address;?>" /></td>
	  </tr>
	  <tr>
	    <td>Country: </td>
	    <td><input type="text" name="units[country]" value="<?php echo $unit->country;?>" /></td>
	  </tr>
	  <tr>
	    <td>City: </td>
	    <td><input type="text" name="units[city]" value="<?php echo $unit->city;?>" /></td>
	  </tr>
	  <tr>
	    <td>State/Country: </td>
	    <td><input type="text" name="units[state]" value="<?php echo $unit->state;?>" /></td>
	  </tr>
	  <tr>
	    <td>Postcode: </td>
	    <td><input type="text" name="units[postcode]" value="<?php echo $unit->postcode;?>" /></td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	  <tr>
	    <td>Published: </td>
	    <td>
	    	<select name="units[published]">
	        	<option value="1" <?php echo ($unit->published == 1 ? 'selected="selected"' : '' );?>>Yes</option>
	            <option value="0" <?php echo ($unit->published == 0 ? 'selected="selected"' : '' );?>>No</option>
	        </select>
	    </td>
	  </tr>
	  <tr>
	    <td>Property Category:</td>
	    <td>
	    	<select name="units[category]">
	    	<option value="0">Select a Category</option>
	    	<?php foreach($categories as $category){?>
	        	<option value="<?php echo $category->id;?>" <?php echo ($unit->category == $category->id ? 'selected="selected"' : '' );?>><?php echo $category->name;?></option>
	        <?php }?>
	        </select>
	    </td>
	  </tr>
	  <tr>
	    <td>Maximum Occupancy:</td>
	    <td><input type="text" size="5" name="units[maximum_occupancy]" value="<?php echo $unit->maximum_occupancy;?>" /></td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	  <tr>
	    <td>Management Company Name: </td>
	    <td><input type="text" size="45" name="units[mgmt_company_name]" value="<?php echo $unit->mgmt_company_name;?>" /></td>
	  </tr>
	  <tr>
	    <td>Local Phone Number: </td>
	    <td><input type="text" name="units[local_phone_number]" value="<?php echo $unit->local_phone_number;?>" /></td>
	  </tr>
	  <tr>
	    <td>Villa phone Number: </td>
	    <td><input type="text" name="units[villa_phone_number]" value="<?php echo $unit->villa_phone_number;?>" /></td>
	  </tr>
	  <tr>
	    <td>Local Contact Name: </td>
	    <td><input type="text" name="units[local_contact_name]" value="<?php echo $unit->local_contact_name;?>" /></td>
	  </tr>
	  <tr>
	    <td>Key Lockbox Code:</td>
	    <td><input type="text" name="units[lockbox_code]" value="<?php echo $unit->lockbox_code;?>" /></td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	  <tr>
	  	<td>Driving Direction:</td>
	    <td><?php echo editorArea( 'editor', $unit->driving_direction, 'units[driving_direction]', '100%;', '300', '8', '30' ) ;?></td>
	  </tr>
	</table>
<input type="hidden" name="form" value="save_property_details">
</form>
<?php $KToolBar->addLink('<a href="#" onclick="document.property_details_form.submit()"><img border="0" alt="Save" src="'.ADMIN_COMPONENT_PATH.'images/save_f2.png"/><br />Save</a>');?>
<?php $KToolBar->addLink('<a href="?option=com_resman&user=owner&page=home"><img border="0" alt="Cancel" src="'.ADMIN_COMPONENT_PATH.'images/cancel_f2.png"/><br />Cancel</a>');?>
<a href="#" onclick="save_property_details()">Save</a>
<a href="?option=com_resman&user=owner&page=home">Cancel</a>
</div>